<template>
	<view>
		<scroll-view class="scroll-view" scroll-y="true" :style="'height:'+scriptHeight+'px'">
			<view class="item">
				<view class="title">成语接龙</view>
				<view class="label">
					<view class="label-text" @click="figth">开始挑战</view>
					
					<view class="label-text" @click="myrecord">我的战绩</view>
					<view class="label-text" @click="ranking">排行榜</view>
				</view>
			</view>
			<view class="item">
				<view class="title">成语趣问小游戏</view>
				<view class="label">
					<view class="label-text" @click="easygame">开始挑战</view>
					
					<view class="label-text" @click="easygamemyrecord">我的战绩</view>
					<view class="label-text" @click="easygamemyranking">排行榜</view>
				</view>
			</view>
			<view class="item">
				<view class="title" style="color: #C0C0C0;">双人对决</view>
				<view class="label">
					<view class="label-text" style="background-color: #C0C0C0;">即将开始</view>
					<view class="label-text" style="background-color: #C0C0C0;">我的战绩</view>
					<view class="label-text" style="background-color: #C0C0C0;">排行榜</view>
					
				</view>
			</view>
		
		</scroll-view>
	</view>
</template>

<script>
	import unils from "../../unils/utils.js"
	export default {
		data() {
			return {
				'scriptHeight':400,
			}
		},
		onReady() {
			this.scriptHeight = uni.getSystemInfoSync().windowHeight;
		},
		onShareAppMessage(res) {
			console.log('========share========');
		    if (res.from === 'button') {// 来自页面内分享按钮
			  console.log(res);
		      console.log(res.target)
		    }
			// console.log(this.openid);
			let openid = uni.getStorageSync('openid');
			// console.log(openid);
		    return {
		      title: '各种好玩的成语游戏，总有一款适合你哦！',
		      path: '/pages/hudong/hudong?share_user_id='+openid,
		    }
		  },
		methods: {
			//成语接龙
			figth:function(){
				unils.needLoginJump("../fight/fight");
				
			},
			myrecord:function(){
				unils.needLoginJump("../myrecord/myrecord");
			},
			ranking:function(){
				unils.needLoginJump("../ranking/ranking");
			},
			//成语趣问小游戏
			easygame:function(){
				unils.needLoginJump("./chengyu_easy_game/chengyu_easy_game");
			},
			easygamemyrecord:function(){
				unils.needLoginJump("./chengyu_easy_game/chengyu_easy_game_record");
			},
			easygamemyranking:function(){
				unils.needLoginJump("./chengyu_easy_game/chengyu_easy_game_ranking");
			}
		}
	}
</script>

<style lang="scss">
.scroll-view{
	height: 450px;
	background-color: $uni-scroll-bg-clolr;
	
	.item{
		background-color: $uni-bg-color;
		margin:10px 10px 15px 10px;
		border-radius: 5px;
		padding: 10px 0 15px 0;
		.title{
			display: flex;
			justify-content: center;
			height: 40px;
			line-height: 40px;
			// background-color: #007AFF;
			font-size: 16px;
			font-weight: bold;
			color: $uni-color-title;
			
		}
		.label{
			font-size: 14px;
			display: flex;
			// margin-bottom: 10px;
			padding: 10px 0;
			justify-content: center;
			
			.label-text{
				display: flex;
				align-items: center;
				justify-content: center;
				height:20px;
				// border: 1px $uni-border-color solid;
				padding: 5px 10px;
				border-radius: 5px;
				margin-left: 10px;
				color:$uni-bg-color;
				// font-weight: bold;
				background-color: $uni-primary-color;
			}
			
		}
	}
}
</style>
